
data=[1,2]

data=[4 if i==2 else i for i in data]

print(data)